<template>
	<view class="container-vip">
		<view class="lang-top">
			<view class="backIcon" @click="back()">
				<uni-icons type="left" size="26"></uni-icons>
			</view>
			<view class="langText"></view>
			<view class="clearView"></view>
		</view>
		<view class="content-view">
			<p class="tittle_verified"> {{$t('红包兑换')}} </p>
			<view class="item_verified">
				<input type="text" v-model="code" :placeholder="$t('兑换码')" class="inp_verified">
			</view>
			<view class="basic_btn" @click="dh">
				{{$t('立即兑换')}}
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				
			}
		},
		methods:{
			dh(){
				let that = this
				that.$http.post(
					'api/dhm/create',//接口名
					{code:this.code},//参数合集
				).then(res=>{
					uni.showToast({
						icon: 'success',
						title: res.msg
					});
					setTimeout(function(){
						// that.getinfo(that.y,that.m)
					},1500)
				},(err)=>{//失败的操作
					uni.showToast({
						icon: 'error',
						title: err.data.message
					});
				})
			},
			back(){
				uni.switchTab({
					url:'/pages/my/index'
				})
			},
		}
	}
</script>

<style scoped>
	.inp_verified{
		flex: 1;
		padding: 0 10px;
		height: 22px;
		font-size: 16px;
		line-height: 22px;
	}
	.item_verified{
		width: 100%;
		height: 45px;
		border-radius: 2px;
		border-bottom: 1px solid rgba(0, 0, 0, .1);
		margin: 40px 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.tittle_verified{
		margin-top: 40px;
		margin-bottom: 20px;
		font-size: 26px;
	}
	.container-vip{
		background-color: #f6f6f6;
	}
	.lang-top{
		display: flex;
		padding-left:10rpx;
		height:88rpx;
		line-height:88rpx;
		background-color: #fff;
	}
	.backIcon{
		width:20%;
	}
	.langText{
		font-size:36rpx;
		width:60%;
		text-align: center;
		
	}
	.clearView{
		width:20%;
	}
	.content-view{
		padding: 0 40rpx;
		margin: 0 auto;
		font-size:24rpx;
		
	}
	.content-view>p{
		line-height:40rpx;
	}
	.basic_btn {
	    height: 45px;
	    line-height: 45px;
	    font-size: 16px;
	    width: 100%;
	    background: linear-gradient(90deg, #e4392e, #ff4d16);
	    border-radius: 23px;
	    color: #fff;
	    text-align: center;
		margin-top: 10px;
	}
</style>